package com.bruan.d1_Date;

import java.util.Date;

public class Test {
    public static void main(String[] args) {
        Date date = new Date();
        System.out.println(date);//系统时间信息
        long time = date.getTime();//获取时间戳
        System.out.println(time);

        //把时间毫秒转换为日期对象
        time += 2 * 1000;
        Date d2 = new Date(time);
        System.out.println(d2);

        Date t3 = new Date();
        t3.setTime(time);//传入时间戳生成对象
        System.out.println(t3);

    }
}
